package com.lottery.game.core.modules.service.game.impl;

import com.lottery.game.common.base.service.impl.AbstractBaseServiceImpl;
import com.lottery.game.core.modules.entity.game.GameApi;
import com.lottery.game.core.modules.service.game.GameApiService;

import org.springframework.stereotype.Service;

import java.util.List;

@Service("gameApiService")
public class GameApiServiceImpl extends AbstractBaseServiceImpl<GameApi> implements GameApiService {

    @Override
    public String[] findByTicket(Integer ticket) {
        GameApi param = new GameApi();
        param.setCode(String.valueOf(ticket));
        param.setStatus("1");
        List<GameApi> apis = this.select(param);
        String[] urls = new String[apis.size()];
        for (int i = 0; i < apis.size(); i ++) {
            urls[i] = apis.get(i).getUrl();
        }
        return urls;
    }
}
